﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="site.aspx.cs" Inherits="GDIT.page.manage.link.site" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>站点链接</title>
    <link href="../../../css/m_site.css" rel="stylesheet" type="text/css" />
</head>
<body>
<form id="form1" runat="server">
<div class="all">


<!--链接开始-->
<div class="group">
    <a class="title">学校概况</a>
    <ul>
        <asp:Repeater ID="CollegeRepeater" runat="server">
            <ItemTemplate>
                <li><a id="<%#DataBinder.Eval(Container.DataItem, "OID") %>" href="javascript:void(0);var href='<%#DataBinder.Eval(Container.DataItem, "LinkAddress") %>';"><%#DataBinder.Eval(Container.DataItem, "MenuName")%></a></li>
            </ItemTemplate>
        </asp:Repeater>
    </ul>
</div><br />
<div class="group">
    <a class="title">招生信息</a>
    <ul>
        <li><a id="A1" href="javascript:void(0);var href='http://www.baidu.com';">高考</a></li>
        <li><a id="A2" href="javascript:void(0);var href='http://www.baidu.com';">专业信息</a></li>
    </ul>
</div>


<script type="text/javascript">
    var as = document.getElementsByTagName("a");
    for (var i = 0; i < as.length; i++) {
        as[i].onclick = as_onclick;
    }

    //弹出层
    function as_onclick() {
        var hyalineNav; //透明层
        var popupNav; //弹出层
        var txtName; //链接文字
        var txtLink; //链接地址
        var linkID = document.getElementById("txtId");
        var alls = document.getElementsByTagName("*");
        for (var i = 0; i < alls.length; i++) {
            if (alls[i].className == "hyaline") {
                hyalineNav = alls[i];
            } else if (alls[i].className == "popup") {
                popupNav = alls[i];
            } else if (alls[i].className == "name") {
                txtName = alls[i];
            } else if (alls[i].className == "link") {
                txtLink = alls[i];
            }
        }
        document.body.focus(); //使链接失去焦点
        hyalineNav.style.display = "block";
        popupNav.style.display = "block";
        txtLink.disabled = ""; //打回原型，可写
        txtLink.value = DealHref(this.href, 1);
        if (this.className == "title") {
            txtLink.disabled = "disabled";
            txtLink.value = "无此项";
        }
        txtName.value = this.innerHTML;
        linkID.innerHTML = this.id;
    }

    //处理id，返回id的相应部分
    function DealHref(href, i) {
        var hrefs = new Array();
        hrefs = href.split("'");
        return hrefs[i];
    }
</script>
<!--链接结束-->



<!--弹出层开始-->
<div class="hyaline"></div>
<div class="popup">
    <asp:Label ID="txtId" runat="server" Visible="false"></asp:Label>
    <a title="关闭" href="javascript:void(0);" class="close" onclick="ClosePopup();"></a>
    <span class="lblName">链接名字：</span>
    <asp:TextBox ID="txtName" runat="server" CssClass="name"></asp:TextBox>
    <span class="lblLink">链接地址：</span>
    <asp:TextBox ID="txtLink" runat="server" CssClass="link" TextMode="MultiLine"></asp:TextBox>
    <asp:LinkButton ID="btnSave" runat="server" NavigateUrl="javascript:void(0);" CssClass="save" Title="保存" OnClick="btnSave_OnClick"></asp:LinkButton>
    <asp:LinkButton ID="btnAdd" runat="server" NavigateUrl="javascript:void(0);" CssClass="add" Title="添加" OnClick="btnAdd_OnClick"></asp:LinkButton>
    <asp:LinkButton ID="btnDelete" runat="server" NavigateUrl="javascript:void(0);" CssClass="delete" Title="删除" OnClick="btnDelete_OnClick"></asp:LinkButton>
</div>
<script type="text/javascript">
    function ClosePopup() {
        var hyalineNav; //透明层
        var popupNav; //弹出层
        var alls = document.getElementsByTagName("*");
        for (var i = 0; i < alls.length; i++) {
            if (alls[i].className == "hyaline") {
                hyalineNav = alls[i];
            } else if (alls[i].className == "popup") {
                popupNav = alls[i];
            }
        }
        hyalineNav.style.display = "none";
        popupNav.style.display = "none";
    }
</script>
<!--弹出层结束-->

</div>
</form>
</body>
</html>
